#pragma once
#include"AbstractLayer.h"
#include<string>

class BallMover;
class OneWallWayContactsListener;

class OneWayWall :public AbstractLayer
{
public:
	friend class OneWallWayContactsListener;

	createScene(OneWayWall)

    CREATE_FUNC(OneWayWall)

	bool init();

	void box2DAppReady() override;

	void update(float dt) override;

	virtual void onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event * event) override;
	
	virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event * event) override;
private:
	const std::string USER_DATA_GROUND = "ground";
	const std::string USER_DATA_FLATFROM = "flatfrom";
	const std::string USER_DATA_PLAYER = "player";

	BallMover* ballMover;
	b2Body* player;
	b2Body* ground;
	b2Body* platfrom;
	OneWallWayContactsListener* listener;
};
